-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: prepare PLC for pmpsdb_client #19
Conversation
This also is ready for review, will ask for reviewers on Monday |
ansible.builtin.lineinfile: | ||
path: /etc/ssh/sshd_config | ||
line: "PasswordAuthentication yes" | ||
insertafter: "^#PasswordAuthentication" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the carrot here in on purpose? @ZLLentz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field is actually a regex, and the ^ indicates the start of a line.
So, ansible reads this as "find a line that starts with #PasswordAuthentication
, then put PasswordAuthentication yes
on the next line if it isn't already there."
The context is that the sshd config file looks like this, with all default values included as comments, and I wanted to put this new config line in a reasonable/known place instead of just at the end of the file.
<snip>
# Change to yes to enable built-in password authentication.
# Note that passwords may also be accepted via KbdInteractiveAuthentication.
#PasswordAuthentication no
#PermitEmptyPasswords no
# Change to no to disable PAM authentication
#KbdInteractiveAuthentication yes
<snip>
And then, after ansible runs here:
<snip>
# Change to yes to enable built-in password authentication.
# Note that passwords may also be accepted via KbdInteractiveAuthentication.
#PasswordAuthentication no
PasswordAuthentication yes
#PermitEmptyPasswords no
# Change to no to disable PAM authentication
#KbdInteractiveAuthentication yes
<snip>
When doing this interactively you'd usually uncomment the line and and change "no" to "yes" but doing it like I've done here is simpler for the script and is easier to revert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left one comment. If that's normal lgtm.
Description
Adds in four ansible tasks intended for making PLCs ready for use by the pmpsdb_client.
The tasks are as follows:
Creating this user can be disabled (and is disabled by default for vms), and it can also be customized to create a different user. The user can be removed later.
Even if the user is created, there must be a manual step to set its password, which ansible does not let you set via file-based plaintext. So, in no cases is a usable automatic extra login created.
This is related to:
pcdshub/lcls-twincat-motion#215
pcdshub/pmpsdb_client#25
Motivation and Context
How Has This Been Tested?
Interactively with my test PLC
Where Has This Been Documented?
https://confluence.slac.stanford.edu/display/PCDS/TcBSD+Ansible+Workflows#TcBSDAnsibleWorkflows-Playbook.1
Pre-merge checklist